<?php

use common\helpers\Html;
use yii\grid\GridView;
use common\models\bonus\Bonus;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', '详情');
$this->params['breadcrumbs'][] = ['label' => '释放奖金','url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <!-- <div class="box-tools">
                    <?= Html::create(['ajax-edit'], '创建', [
                        'data-toggle' => 'modal',
                        'data-target' => '#ajaxModal',
                    ]) ?>
                </div> -->
            </div>
            <div class="box-body table-responsive">
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                    //重新定义分页样式
                    'tableOptions' => [
                        'class' => 'table table-hover rf-table',
                        'fixedNumber' => 2,
                        'fixedRightNumber' => 1,
                    ],
                    'columns' => [
                        ['class' => 'yii\grid\SerialColumn'],
                        [
                            'attribute' => 'member.username',
                            'label'=> '会员',
                            'filter' => Html::activeTextInput($searchModel, 'member.username', [
                                    'class' => 'form-control'
                                ]
                            ),
                        ],
                        [
                            'attribute'=> 'type',
                            'value' => function($model){
                                return Bonus::getBonusName($model->type);
                            }
                        ],
                        
                        'amount',
                        'created_at:datetime',
                    ],
                ]); ?>
            </div>
        </div>
    </div>
</div>